package com.online.service;

import com.online.dao.CourseContactClassMapper;
import com.online.entity.CourseContactClass;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseContactClassServiceImpl implements CourseContactClassService {

    @Autowired
    CourseContactClassMapper courseContactClassMapper;

    @Override
    public int insertARecord(CourseContactClass courseContactClass) {
        return courseContactClassMapper.insertARecord(courseContactClass);
    }

    @Override
    public int deleteARecordByCourseId(Integer courseId) {
        return courseContactClassMapper.deleteARecordByCourseId(courseId);
    }

    @Override
    public int deleteARecordByClassId(Integer classId) {
        return courseContactClassMapper.deleteARecordByClassId(classId);
    }

    @Override
    public List<Integer> selectCourseIdByClassId(int classId) {
        return courseContactClassMapper.selectCourseIdByClassId(classId);
    }

    @Override
    public CourseContactClass selectById(Integer courseId, Integer classId) {
        return courseContactClassMapper.selectbyId(courseId,classId);
    }

    @Override
    public List<CourseContactClass> selectClassId(Integer courseId) {
        return courseContactClassMapper.selectClassByCourseId(courseId);
    }
}
